Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@breejs/later
Advanced tools
Maintained fork of later. Determine later (or previous) occurrences of recurring schedules
@breejs/later is a scheduling library for JavaScript that allows you to define complex schedules using natural language or cron-like syntax. It is useful for tasks that need to be executed at specific times or intervals.
Basic Scheduling
This feature allows you to define a schedule using natural language and execute a function at the specified intervals.
const later = require('@breejs/later');
// Define a schedule to run every 5 minutes
const sched = later.parse.text('every 5 mins');
// Execute a function based on the schedule
later.setInterval(() => {
console.log('This runs every 5 minutes');
}, sched);
Cron Scheduling
This feature allows you to define a schedule using cron syntax, which is useful for more complex scheduling needs.
const later = require('@breejs/later');
// Define a schedule using cron syntax
const sched = later.parse.cron('0 0 * * *'); // Every day at midnight
// Execute a function based on the schedule
later.setInterval(() => {
console.log('This runs every day at midnight');
}, sched);
Custom Intervals
This feature allows you to define custom intervals for scheduling tasks, providing flexibility for various use cases.
const later = require('@breejs/later');
// Define a custom schedule
const sched = later.parse.recur().every(2).hour().first().minute();
// Execute a function based on the custom schedule
later.setInterval(() => {
console.log('This runs every 2 hours at the first minute');
}, sched);
node-cron is a lightweight task scheduler in pure JavaScript for Node.js based on the cron syntax. It is simpler and more focused on cron-based scheduling compared to @breejs/later.
agenda is a light-weight job scheduling library for Node.js. It offers MongoDB-backed persistence and is more suitable for complex job scheduling and management compared to @breejs/later.
node-schedule is a flexible cron-like and not-cron-like job scheduler for Node.js. It supports both cron and non-cron syntax, similar to @breejs/later, but with a different API and feature set.
This project is a maintained fork of Later, as I needed it to be maintained and modernized for Bree. Later is a library for describing recurring schedules and calculating their future occurrences. It supports a very flexible schedule definition including support for composite schedules and schedule exceptions. Create new schedules manually, via Cron expression, via text expressions, or using a fully chainable API.
Types of schedules supported by Later:
See https://breejs.github.io/later/ for complete documentation and usage.
npm:
npm install @breejs/later
yarn:
yarn add @breejs/later
const later = require('@breejs/later');
console.log(later);
This is the solution for you if you're just using <script>
tags everywhere!
<script src="https://unpkg.com/@breejs/later"></script>
<script type="text/javascript">
(function() {
console.log(later);
})();
</script>
Assuming you are using browserify, webpack, rollup, or another bundler, you can simply follow Node usage above.
Name | Website |
---|---|
BunKat | |
Nick Baugh | http://niftylettuce.com/ |
MIT © BunKat
FAQs
Maintained fork of later. Determine later (or previous) occurrences of recurring schedules
The npm package @breejs/later receives a total of 141,529 weekly downloads. As such, @breejs/later popularity was classified as popular.
We found that @breejs/later demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.